package com.fenqing.comics.dao.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fenqing.comics.dao.ISourceDao;
import com.fenqing.comics.dao.mapper.SourceMapper;
import com.fenqing.comics.entity.SourceEntity;
import com.fenqing.comics.enums.SourceEnums;
import org.springframework.stereotype.Repository;

/**
 * 资源表(Source)表数据库访问层
 * @author fenqing
 */
@Repository
public class SourceDaoImpl extends ServiceImpl<SourceMapper, SourceEntity>
        implements ISourceDao {


    @Override
    public SourceEntity getByCode(SourceEnums.Code code) {
        return this.lambdaQuery()
                .eq(SourceEntity::getCode, code)
                .one();
    }

}
